<template>
  <div>
     <input type="text" @keyup.enter="fn">
     <input type="text" @keyup.esc="fn1">
  </div>
</template>

<script>
export default {
    methods: {
       fn(){
          console.log('摁下了回车');
       },
       fn1(){
          console.log('摁下了esc');
       }
    }
}
</script>

<style>

</style>